package com.multi.thread.chapter02.demo08.test01;

public class Run {
	
	//当多个线程同时执行synchronized(x){}同步代码块时呈同步效果
	public static void main(String[] args) {
		Service service = new Service();
		MyObject object = new MyObject();
		MyThread01 thread01 = new MyThread01(service, object);
		thread01.setName("a");
		thread01.start();
		MyThread02 thread02 = new MyThread02(service, object);
		thread02.setName("b");
		thread02.start();
	}

}
